/*
 * Wazuh databaseFeedManager
 * Copyright (C) 2015, Wazuh Inc.
 * October 9, 2023.
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License (version 2) as published by the FSF - Free Software
 * Foundation.
 */

#ifndef _UPDATE_CVE_CANDIDATES_TEST_H
#define _UPDATE_CVE_CANDIDATES_TEST_H

#include "../../src/databaseFeedManager/updateCVECandidates.hpp"
#include "databaseFeedManager.hpp"
#include "gtest/gtest.h"
#include <filesystem>
#include <vector>

const std::vector<std::string> PROVIDERS = {{"Canonical"}, {"NVD"}, {"Debian"}, {"RedHat"}, {"SUSE"}};

/**
 * @brief This test class contains unit tests for the UpdateCVECandidates module.
 */
class UpdateCVECandidatesTest : public ::testing::Test
{
protected:
    /**
     * @brief Map that contains the RocksDB instances.
     *
     */
    std::unique_ptr<Utils::IRocksDBWrapper> m_feedDatabase;

    /**
     * @brief Construct a new UpdateCVECandidatesTest object
     *
     */
    UpdateCVECandidatesTest() = default;

    /**
     * @brief Destroy the UpdateCVECandidatesTest object
     *
     */
    virtual ~UpdateCVECandidatesTest() = default;

    /**
     * @brief SetUp.
     *
     */
    void SetUp()
    {
        m_feedDatabase = std::make_unique<Utils::RocksDBWrapper>(DATABASE_PATH);
    };

    /**
     * @brief TearDown.
     *
     */
    void TearDown()
    {
        m_feedDatabase->deleteAll();
        m_feedDatabase.reset();
        std::filesystem::remove_all(DATABASE_PATH);
    };
};

#endif //_UPDATE_CVE_CANDIDATES_TEST_H
